package com.turing.post.common.util;

import java.io.Serializable;
import java.math.BigInteger;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import com.turing.post.util.PCPSUtil;

/**
 * 黑名单
 * 
 * @author zxp
 * @Dec 17, 2012
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "BlackList")
@IdClass(BlackList.class)
public class BlackList implements Serializable {
	/**
	 * 证件类型编号
	 */
	private BigInteger idTypeId;
	/**
	 * 证件号
	 */
	private String idNo;

	/**
	 * 国家地区编码
	 */
	private String nationCodeId;
	/**
	 * 名称
	 */
	private String name;
	/**
	 * 证件图片ID
	 */
	private BigInteger idImageId;
	/**
	 * 其他图片ID
	 */
	private BigInteger idImage1Id;
	/**
	 * 备注
	 */
	private String remark;

	public BlackList() {

	}

	@Id
	@Column(name = "IdTypeId", nullable = false)
	public BigInteger getIdTypeId() {
		return idTypeId;
	}

	public void setIdTypeId(BigInteger idTypeId) {
		this.idTypeId = idTypeId;
	}

	@Id
	@Column(name = "IdNo", nullable = false)
	public String getIdNo() {
		return idNo;
	}

	public void setIdNo(String idNo) {
		this.idNo = idNo;
	}

	@Column(name = "NationCodeId")
	public String getNationCodeId() {
		return nationCodeId;
	}

	public void setNationCodeId(String nationCodeId) {
		this.nationCodeId = nationCodeId;
	}

	@Column(name = "Name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "idImageId")
	public BigInteger getIdImageId() {
		return idImageId;
	}

	public void setIdImageId(BigInteger idImageId) {
		this.idImageId = idImageId;
	}

	@Column(name = "IDIMAGE1ID")
	public BigInteger getIdImage1Id() {
		return idImage1Id;
	}

	public void setIdImage1Id(BigInteger idImage1Id) {
		this.idImage1Id = idImage1Id;
	}

	@Column(name = "Remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((this.getIdTypeId() == null) ? 0 : this.getIdTypeId()
						.hashCode());
		result = prime * result
				+ ((this.getIdNo() == null) ? 0 : this.getIdNo().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof BlackList))
			return false;
		BlackList other = (BlackList) obj;
		if (!PCPSUtil.compareObject(this.getIdTypeId(), other.getIdTypeId()))
			return false;
		return PCPSUtil.compareObject(this.getIdNo(), other.getIdNo());
	}
}